#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <string>
#include <iomanip>
#include <locale>
#include <sstream>
#include <map>
using namespace std;

int main(int argc, char **argv)
{
    ofstream stock_file ;
    stock_file.open("processes_stock_list.txt");
    
    ifstream myfile;
    myfile.open("stock_list.txt");

    // Runthis while there are elements in the file
    while (myfile.good()) {
        string line;
        getline(myfile, line);

        // Rotating position for the occurence of comma
        size_t found = 0, loop_found;
        double result;

        // Convert the string to a number

        string name;
        while(line.size()) {
            loop_found = line.find_first_of(",");
            name = line.substr(found , loop_found);
            stock_file << name << endl;    

            line = line.substr(loop_found + 1, line.size() - 1);
            found = 0;
        }
    }
    // Close my file
    myfile.close(); 
    stock_file.close();
}
